package com.cn.api;

import com.cn.common.parameter.Paging;
import com.cn.dto.ScenicDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;

@Primary
@FeignClient(value = "product-client",path = "/scenic")
public interface ScenicCoreService {
    //查询所有景区
    @GetMapping("/findAll")
    List<ScenicDTO> findAll(@RequestBody Paging paging);

    //根据id查询景区信息
    @GetMapping("/findById")
    ScenicDTO findById(@RequestParam(value = "scenicId") Integer scenicId);

    //添加景区信息
    @PostMapping("/add")
    int add(@RequestBody ScenicDTO scenicDTO);

    //根据id删除景区（逻辑删除）
    @PostMapping("/delete")
    int delete(@RequestParam("scenicId") Integer scenicId);

    //修改景区信息
    @PostMapping("/update")
    int update(@RequestBody ScenicDTO scenicDTO);

    //根据某条件查询景区
    @GetMapping("/findCondition")
    List<ScenicDTO> findCondition(@RequestBody ScenicDTO scenicDTO);

}
